{include file="public/header" /}
<link rel="stylesheet" href="/static/admin/addons/builder/css/base.css" media="all" xmlns:>
{include file="product/cope/css" /}
<body>
<form class="layui-form" id="form" action="{:url('save')}" lay-filter='form'>
    <div class="layui-fluid layui-anim layui-anim-downbit">
        {include file="public/referrer" /}

        <div class="layui-card">

            <div class="layui-card-body" style="padding: 15px;">


                <input type="hidden" name="id" id="id" value="{$info?$info.id:''}"/>
                <div class="layui-tab layui-tab-brief" lay-filter="brief">
                    <ul class="layui-tab-title">
                        <li class="layui-this">商品信息</li>
                        <li>规格库存</li>
                        <li>商品详情</li>
                    </ul>
                    <div class="layui-tab-content">
                        <div class="layui-tab-item layui-show">
                            <div class="layui-form-item">
                                <label class="layui-form-label req">商品名称</label>
                                <div class="layui-input-block">
                                    <input type="text" name="title" placeholder="请填写商品名称" class="layui-input"
                                           value="{$info?$info.title:''}"/>
                                </div>
                            </div>
                            <!-- 引入分类  -->
                            {include file="product/cope/cate" /}
                            <!-- 引入分类End -->

                            <div class="layui-form-item">
                                <label class="layui-form-label">排序</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="sort" autocomplete="off"
                                           placeholder="请输入排序，越小越靠前"
                                           class="layui-input"
                                           value="{$info?$info.sort:''}">
                                </div>
                            </div>

                            <div class="layui-form-item">

                                <label class="layui-form-label req">商品轮播图</label>
                                <?php $data = isset($info)?$info:[];?>
                                {table:alone view='items/img' info='$data' form='["field" => "images", "value" => 2]'/}

                                <div class="layui-form-mid layui-text-em layui-text-em2">
                                    * 建议尺寸：800*800，默认首张图为主图，最多上传10张，拖动图片可排序
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <div class="layui-inline">
                                    <label class="layui-form-label">虚拟销量</label>
                                    <div class="layui-input-inline">
                                        <input type="text" name="virtual_sales" value="{$info?$info.virtual_sales:''}"
                                               placeholder="请填写虚拟销量" autocomplete="off" class="layui-input"
                                               onkeyup="value=value.replace(/[^\d{1,}\.\d{1,}|\d{1,}]/g,'')">
                                    </div>
                                    <div class="layui-form-mid layui-text-em layui-text-em">
                                        如若填写，前台销量将展示此数据
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="layui-tab-item">
                            {include file="product/cope/spec" /}
                        </div>
                        <div class="layui-tab-item">
                            <label class="layui-form-label req">详情</label>
                            <div class="layui-input-block">
                                {table:alone view='items/editor' info='$data' form='["field" => "content"]'/}
                            </div>
                        </div>
                    </div>
                </div>
                <input type="hidden" id="uid" name="uid" value="">
            </div>
        </div>
    </div>
    <div class="layui-footer" style="left: 0;">
        <a class="layui-btn" data-back-url="{$backUrl}" lay-filter="saveProduct" lay-submit>保存</a>
    </div>
</form>
</body>
{include file="public/footer" /}
<script type="text/javascript" src="/static/admin/js/jquery-ui.js"></script>
{include file="product/cope/js" /}
</html>